<?php
declare(strict_types=1);
namespace App\Api;

use App\ApiController;

use Field\SysMenuConst;
use Field\SysPagesConst;
use Field\SysRoleAuthConst;
use Field\SysRoleConst;


// hook api_menu_use.php

/**
 * @title   反馈
 * @auth    true
 * @rank    3
 */
class Back extends ApiController
{
    // hook api_menu_start.php

    /**
     * @title  下发反馈配置
     * @rank    0
     */
    public function action_Conf_PUT()
    {
        $BizCode = $this->request->param('BizCode','');
        $AddForm = [
            ['prop'=>'typeid','label'=>'反馈类型','component'=>'radioGroup','dict'=>'back','noall'=>1],
            ['prop'=>'text','label'=>'反馈内容','component'=>'input','type' => 'textarea','rows'=>6],
            ['prop'=>'attach','label'=>'反馈图片','component'=>'uploads'],
         ];
        $this->response('0000', ['BizCode' =>$BizCode,'data'=>$AddForm]);
    }
     /**
     * @title  提交反馈
     * @login true
     * @rank    99
     */
    public function action_Index_POST(): void
    {
        $pinyin = $this->request->param(SysPagesConst::Pinyin);
        $this->CheckEmpty([$pinyin],['路径']);
        $data = $this->SysPages->readByPinYin($pinyin);
        $this->response('0000',['data' => $data]);
    }

    // hook api_menu_end.php

}

?>